<?php

namespace app\common\model\vip;

use think\Model;

/**
 * Record
 */
class Record extends Model
{
    // 表名
    protected $name = 'ai_vip_record';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = true;
    protected $updateTime = false;

    // 字段类型转换
//    protected $type = [
//        'due_time' => 'timestamp:Y-m-d H:i:s',
//    ];


    public function user(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\User::class, 'user_id', 'id');
    }

    public function vip(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\ai\Vip::class, 'vip_id', 'id');
    }
}